#include "PhysicObject.h"

PhysicObject::PhysicObject()
{
}

PhysicObject::~PhysicObject()
{

}

void PhysicObject::createPhysicBody()
{

}

void PhysicObject::beginContact(b2Fixture *ownFixture, b2Fixture *otherFixture, b2Contact *contact)
{

}

void PhysicObject::endContact(b2Fixture *ownFixture, b2Fixture *otherFixture, b2Contact *contact)
{

}

void PhysicObject::update(float dt)
{
    if (this->isActive) {
        sprite->setPosition(CCPointMake(physicBody->GetPosition().x * PTM_RATIO,
                                        physicBody->GetPosition().y * PTM_RATIO));
    }
}

void PhysicObject::removeObject()
{
    if (physicBody) {
        handler->destroyBody(physicBody);
    }

    GameObject::removeObject();
}
